import typing


class Tkinter属性修改器:
    @staticmethod
    def 修改文本(widget, text):
        widget.configure(text=text)

    @staticmethod
    def 修改背景颜色(widget, color):
        widget.configure(bg=color)
        
    @staticmethod
    def 修改前景颜色(widget, color):
        widget.configure(fg=color)

    @staticmethod
    def 修改字体(widget, font_name:typing.Literal["Arial","Helvetica","Times New Roman","Courier","Comic Sans MS","微软雅黑"]="Arial",
             font_size:int=10,
             font_style:typing.Literal["bold","italic","underline","overstrike"]="bold"):
        
        widget.configure(font=(font_name, font_size, font_style))

    @staticmethod
    def 修改宽度(widget, size):
        widget.configure(width=size)

    @staticmethod
    def 修改高度(widget, size):
        widget.configure(height=size)

    @staticmethod
    def 修改位置(widget, x, y):
        widget.place(x=x, y=y)
        
    @staticmethod
    def 修改激活背景颜色(widget, color):
        widget.configure(activebackground=color)
    
    @staticmethod
    def 修改激活前景颜色(widget, color):
        widget.configure(activeforeground=color)

    @staticmethod
    def 修改边框宽度(widget, size):
        widget.configure(borderwidth=size)
        
    @staticmethod
    def 修改禁用前景颜色(widget, color):
        widget.configure(disabledforeground=color)
        
    @staticmethod
    def 修改字体样式(widget, style):
        widget.configure(font=style)

    @staticmethod
    def 修改没有焦点时的高亮颜色(widget,color):
        widget.configure(highlightbackground=color)